/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-16 17:00:59
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-17 10:20:27
 */
class CameraItemModel {
  String name;
  String ip;
  bool status;

  CameraItemModel({this.name, this.ip, this.status});

  CameraItemModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    ip = json['ip'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['ip'] = this.ip;
    data['status'] = this.status;
    return data;
  }
}

class CameraDetailModel {
  List<Warnings> warnings;
  String name;
  Source source;

  CameraDetailModel({this.warnings, this.name, this.source});

  CameraDetailModel.fromJson(Map<String, dynamic> json) {
    if (json['warnings'] != null) {
      warnings = new List<Warnings>();
      json['warnings'].forEach((v) {
        warnings.add(new Warnings.fromJson(v));
      });
    }
    name = json['name'];
    source =
        json['source'] != null ? new Source.fromJson(json['source']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.warnings != null) {
      data['warnings'] = this.warnings.map((v) => v.toJson()).toList();
    }
    data['name'] = this.name;
    if (this.source != null) {
      data['source'] = this.source.toJson();
    }
    return data;
  }
}

class Warnings {
  String name;
  String time;
  String snap;

  Warnings({this.name, this.time, this.snap});

  Warnings.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    time = json['time'];
    snap = json['snap'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['time'] = this.time;
    data['snap'] = this.snap;
    return data;
  }
}

class Source {
  String rtmp;
  String mp4;
  String flv;
  String rtsp;
  String hls;
  String ts;

  Source({this.rtmp, this.mp4, this.flv, this.rtsp, this.hls, this.ts});

  Source.fromJson(Map<String, dynamic> json) {
    rtmp = json['rtmp'];
    mp4 = json['mp4'];
    flv = json['flv'];
    rtsp = json['rtsp'];
    hls = json['hls'];
    ts = json['ts'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['rtmp'] = this.rtmp;
    data['mp4'] = this.mp4;
    data['flv'] = this.flv;
    data['rtsp'] = this.rtsp;
    data['hls'] = this.hls;
    data['ts'] = this.ts;
    return data;
  }
}
